﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Web.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MVCWeb.Models.OrderModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>My Carts</h2>

    <table>
        <tr>
            <th></th>
            <th>
                Order ID
            </th>
            <th>
                Total Price
            </th>
            <th>
                Date Added
            </th>
            <th>
                Order Placed
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink("View Cart", "WebDetails", "Order", new { id = item.order_id }, null)%> 
                <%: Html.ActionLink("Place Order", "WebPlaceOrder", "Order", new { placeid = item.order_id}, null)%>
            </td>
            <td>
                <%: item.order_id %>
            </td>
            <td>
                <%: String.Format("{0:F}", item.total_price) %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.date_created) %>
            </td>
            <td>
                <%: item.is_ordered %>
            </td>
        </tr>
    
    <% } %>

    </table>


    <p>
        <%: Html.ActionLink("Create New", "WebCreate", "Order")%>
    </p>

</asp:Content>


